﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" Debug="true" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>无标题页</title>
    <script language="javascript">
        function checkDel(str)
        {
            if(!confirm("确认删除 "+str+" 吗？"))
                return(false);
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <table style="margin:0 auto;">
        <tr><td>项目名称：</td><td><asp:TextBox ID="CreatPro" runat="server"></asp:TextBox></td>
        <td>数据表名：</td><td><asp:TextBox ID="CreatTB" runat="server"></asp:TextBox></td></tr>
    </table>
    <asp:GridView ID=myGridView runat=server AutoGenerateColumns=False
        AllowPaging=True PageSize=1000 AllowSorting=True
         HorizontalAlign=Center AutoGenerateDeleteButton="True" 
                AutoGenerateEditButton="True" Width="1000px"
          DataKeyNames="ID" CellPadding="4" ForeColor="#333333" GridLines="None" 
                OnRowCancelingEdit="myGridView_RowCancelingEdit" 
                OnRowUpdating="myGridView_RowUpdating" OnRowDeleting="myGridView_RowDeleting" 
                OnRowEditing="myGridView_RowEditing" OnDataBound="myGridView_DataBound" 
                onpageindexchanging="myGridView_PageIndexChanging" Font-Size="Small">
         <PagerStyle HorizontalAlign=Center ForeColor=White BackColor="#284775" />
            <Columns>
                <asp:BoundField HeaderText="编号" DataField=ID ReadOnly=True />
                
                <asp:TemplateField HeaderText="项目">
                    <ItemTemplate>
                        <asp:Label ID=showProjectName runat=server Text='<%# Eval("projectName") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                
                <asp:TemplateField HeaderText="数据表">
                    <ItemTemplate>
                        <asp:Label ID=showTableName runat=server Text='<%# Eval("tableName") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                
                <asp:TemplateField HeaderText="列名">
                    <ItemTemplate>
                        <asp:Label ID=showColumnName runat=server Text='<%# Eval("columnName") %>'></asp:Label>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID=txtColumnName runat=server Text='<%# Eval("columnName") %>'></asp:TextBox>
                    </EditItemTemplate>
                </asp:TemplateField>
                
                <asp:TemplateField HeaderText="类型">
                    <ItemTemplate>
                        <asp:Label ID=showColumnType runat=server Text='<%# Eval("columnType") %>'></asp:Label>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:RadioButtonList ID="txtColumnType" runat="server" TextAlign="Left" RepeatColumns="2">
                        <asp:ListItem Value="string" Selected>string</asp:ListItem>
                        <asp:ListItem Value="DateTime">DateTime</asp:ListItem>
                        </asp:RadioButtonList>
                    </EditItemTemplate>
                </asp:TemplateField>
                
                <asp:TemplateField HeaderText="说明">
                    <ItemTemplate>
                        <asp:Label ID=showColumnMemo runat=server Text='<%# Eval("columnMemo") %>'></asp:Label>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID=txtColumnMemo runat=server Text='<%# Eval("columnMemo") %>'></asp:TextBox>
                    </EditItemTemplate>
                </asp:TemplateField>
                
                <asp:TemplateField ShowHeader="False">
                    <ItemTemplate>
                        <asp:LinkButton ID="txtDel" runat="server" CausesValidation="False" CommandArgument='<%# Eval("ID") %>'
                            OnClick="txtDel_Click" Text="Del"></asp:LinkButton>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
            <PagerSettings FirstPageText="第一页" LastPageText="最末页"
                NextPageText="下一页" PreviousPageText="上一页" />
            <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" HorizontalAlign="Center" 
             VerticalAlign="Middle" />
            <EditRowStyle BackColor="#999999" />
            <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
            <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" 
             HorizontalAlign="Left" VerticalAlign="Middle" Wrap="False" />
            <AlternatingRowStyle BackColor="White" ForeColor="#284775" 
             VerticalAlign="Top" Wrap="False" />
        </asp:GridView>
        <center><asp:Button ID="BtAdd" runat="server" Text="新增" OnClick="BtAdd_Click" />
        <asp:Button ID="BtSave" runat="server" Text="保存" OnClick="BtSave_Click"/>
        <asp:Button ID="BtCreate" runat="server" Text="生成" onclick="BtCreate_Click" /></center></div>
    </form>
</body>
</html>
